package com.shop.shoporder.service.impl;


import com.shop.shoporder.entity.order.Area;
import com.shop.shoporder.mapper.order.AreaMapper;
import com.shop.shoporder.service.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("areaService")
public class AreaServiceImpl implements AreaService {

    @Autowired
    AreaMapper areaMapper;
    @Override
    public int deleteByPrimaryKey(int id) throws Exception{
        return areaMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Area record) throws Exception{
        return areaMapper.insert(record);
    }

    @Override
    public int insertSelective(Area record) throws Exception {
        return areaMapper.insertSelective(record) ;
    }

    @Override
    public Area selectByPrimaryKey(int id) throws Exception{
        return areaMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Area record) throws  Exception{
        return areaMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Area record) throws Exception{
        return areaMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<Area> selectAddressByParentId(int id) throws Exception {
        return areaMapper.selectAddressByParentId(id);
    }

    @Override
    public List<Area> selectAreaList(int parentId, int level) {
        return areaMapper.selectAreaList(parentId,level);
    }
}
